﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Windows.Controls.Primitives;

namespace Microsoft.Forums.ForumsClient.Views
{
    /// <summary>
    ///  ToggleButton that supports a Source and Text propery. 
    /// </summary>
    public class TextImageToggleButton : ToggleButton
    {
        /// <summary>
        ///  Image that should be shown within button.
        /// </summary>
        public ImageSource Source
        {
            get { return base.GetValue(SourceProperty) as ImageSource; }
            set { base.SetValue(SourceProperty, value); }
        }

        /// <summary>
        ///  The Text that needs to be displayed next to the image.
        /// </summary>
        public String Text
        {
            get { return base.GetValue(TextProperty).ToString(); }
            set { base.SetValue(TextProperty, value); }
        }

        /// <summary>
        /// Dependency property for Source image
        /// </summary>
        public static readonly DependencyProperty SourceProperty =
            DependencyProperty.Register("Source", typeof(ImageSource), typeof(TextImageToggleButton));

        /// <summary>
        /// Dependency property for the Text 
        /// </summary>
        public static readonly DependencyProperty TextProperty =
        DependencyProperty.Register("Text", typeof(String), typeof(TextImageToggleButton));
    }
}
